(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $http = $http;
		var $httpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$http({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $httpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $http = $http;
		var $httpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$http({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $httpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$http({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $httpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$http({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					response.text;
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					cnonsole.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					cnonsole.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						//window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						//window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				//window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						//window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				//window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						//window.location.href="/index.php"
					}
			});
		}
	}
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.userName) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.user.name) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				//window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						//window.location.href="/index.php"
					}
			});
		}
	}
<<<<<<< HEAD
})();
(function() {
    headController.$inject = ["$scope", "$rootScope"];
    appCommon.controller('headCtr', headController);  

    function headController($scope, $rootScope) {
    	var href = location.href.split("/")
    	var type = href[href.length - 1];
    	if(type !== "login" && type !== "register") {
    		$rootScope.view = "has-banner";  
    	} 
    }
})();
(function() { 
    // ng路由
  	appCommon.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
        $routeProvider

        //首页
        .when('/index', {
            templateUrl: '/Public/client/js/index/index.html'
        })   

        //登录
        .when('/login', {
            templateUrl: '/Public/client/js/login/index.html'
        })        

        //用户信息
        .when('/userInfo', {
            templateUrl: '/Public/client/js/userInfo/index.html'
        })        

        //默认跳转
        .otherwise({
            templateUrl: '/Public/client/js/index/index.html'
        });

        //$locationProvider.html5Mode(true);
    }]); 
})();

(function() {
    loginController.$inject = ["$scope", "$rootScope", "$http", "$httpParamSerializer"];
    registerController.$inject = ["$scope", "$http", "$httpParamSerializer"];
    appCommon.controller('loginCtr', loginController);
    appCommon.controller('registerCtr', registerController);

    //登录
    function loginController($scope, $rootScope, $http, $httpParamSerializer) {   
        $rootScope.view = "";                  
        $scope.save = function() {
            if($scope.userName) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/login',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password
                    }),
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                    var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0) {
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response);
               });
            }
        }
    };

    //注册
    function registerController($scope, $http, $httpParamSerializer) {
        $scope.save = function() {
            if($scope.userName) {
                $http({
                    method: 'POST',
                    url: '/index.php/Home/Login/register',
                    data: $httpParamSerializer({
                        'userName': $scope.userName,
                        'password': $scope.password,
                        'email': $scope.email
                    }),
                    headers:{'Content-Type': 'application/x-www-form-urlencoded'}
                }).then(function successCallback(response) {
                   var data = response.data;
                    if(data.status === 1) {
                        window.location.href="/index.php/Home"
                    }else if(data.status === 0){
                        if(data.type === "userNameError") {
                            $scope.userNameError = "show";
                            $scope.passwordError = "";
                            $scope.userNameMessage = data.message;
                        }else if(data.type === "passwordError") {
                            $scope.userNameError = "";
                            $scope.passwordError = "show";
                            $scope.passwordMessage = data.message;
                        }
                    }
                }, function errorCallback(response) {
                    alert(response)
                });
            }
        }
    };
})();

(function() { 
	userInfoCtroller.$inject = ["$rootScope", "$scope", "$http", "$httpParamSerializer"];
	appCommon.controller('userInfoCtr', userInfoCtroller);

	function userInfoCtroller($rootScope, $scope, $http, $httpParamSerializer) {		
		$rootScope.view = "";
		var $shttp = $http;
		var $shttpParamSerializer = $httpParamSerializer;
		$http({
			method: "POST",
			url: "/index.php/Home/user/index"
		}).then(function successCallback(response) {
			var result = response.data;
			if(result.status) { 
				$scope.userName = result.data.username;
				$scope.email = result.data.email;
				$scope.password = result.data.password;				
			}else {
				//暂无404页面
				//window.location.href="/index.php"
			}
		});

		$scope.save = function($http, $httpParamSerializer) {
			$shttp({
				method: "POST",
				url: "/index.php/Home/user/updateInfo",
				data: $shttpParamSerializer({
                    'userName': $scope.userName,
                    'email': $scope.email,
                    'password': $scope.password
                }),
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
				}).then(function successCallback(response) {
					var result = response.data;
					console.log(result)
					if(result.status) { 
							
					}else {
						//暂无404页面
						//window.location.href="/index.php"
					}
			});
		}
	}
=======
>>>>>>> 6747f631180bf36d5c612491ae014d567778c78f
})();